
<!DOCTYPE html>
<html lang="zh-CN" class="loading">
<head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>三·钻 TriDiamond</title>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate">
    <meta name="keywords" content="TriDiamond Obsidian,"> 
    
    <meta name="author" content="三·钻 TriDiamond"> 
    <link rel="alternative" href="atom.xml" title="三·钻 TriDiamond" type="application/atom+xml"> 
    <link rel="icon" href="/img/favicon.png"> 
    <link href="https://fonts.loli.net/css?family=Roboto+Mono|Rubik&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_1429596_nzgqgvnmkjb.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.7.2/animate.min.css">
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/codemirror.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/theme/dracula.css">
    <link rel="stylesheet" href="/css/obsidian.css">
    <link rel="stylesheet" href="/css/ball-atom.min.css">
</head>
</html>

<body class="loading">
    <div class="loader">
        <div class="la-ball-atom la-2x">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <span id="config-title" style="display:none">三·钻 TriDiamond</span>
    <div id="loader"></div>
    <div class="nav">
    <ul id="menu-menu" class="menu">
        
        <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
            <a href="/whoami/" title="ABOUT">ABOUT</a>
        </li>
        
        <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
            <a href="/categories/" title="CATEGORIES">CATEGORIES</a>
        </li>
        
        <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
            <a href="/tags/" title="TAGS">TAGS</a>
        </li>
        
        <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
            <a href="/archives/" title="ARCHIVES">ARCHIVES</a>
        </li>
        
    </ul>
    <p class="copyright" id="copyright">
        &copy; 2019 三·钻 TriDiamond.
        Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
        Theme <a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
    </p>
</div>

<div id="container">
    
<div class="search-box">
    <form class="site-search-form">
        <span class="iconfont icon-search"></span>
        <input type="text" id="local-search-input" class="st-search-input" />
        <div class="iconfont icon-cross search-box-close"></div>
    </form>
    <div class="search-scrollable">
        <div id="local-search-result" class="local-search-result-cls" data-initialise="首次搜索，正在载入索引文件，请稍后……"
            data-start="输入关键词搜索。" data-empty="没有找到内容，请尝试更换检索词。">
            <span>输入关键词搜索。</span>
        </div>
    </div>
</div>
<div id="header">
    <div>
        <div class="logo animated fadeInDown">
            <img src="/img/favicon.png" alt="">
            <a class="image-logo" href="/"></a>
        </div>
        <ul id="menu-menu" class="menu text-menu">
            
            <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
                <a href="/whoami/" title="ABOUT" class="menu-link">ABOUT</a>
            </li>
            
            <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
                <a href="/categories/" title="CATEGORIES" class="menu-link">CATEGORIES</a>
            </li>
            
            <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
                <a href="/tags/" title="TAGS" class="menu-link">TAGS</a>
            </li>
            
            <li class="animated fadeInDown menu-item menu-item-type-post_type menu-item-object-page">
                <a href="/archives/" title="ARCHIVES" class="menu-link">ARCHIVES</a>
            </li>
            
            
            <li class="animated fadeInDown search-bar iconfont icon-search"></li>
            
        </ul>
        <div class="iconfont icon-menu switchmenu gradient-text animated fadeInDown"></div>
    </div>
</div>
<div id="screen">
    <div id="mark">
        <div class="cover animated fadeIn" style="
            animation-delay: 900ms;
            animation-duration: 2.8s;
            background-image:
                radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.56), #100e17),
                url(https://res.cloudinary.com/tridiamond/image/upload/v1572613799/blog/simplify-your-javascript-with_acr2px.jpg);">
        </div>
    </div>
    
    <div id="post0" class="else">
        <p class="animated fadeInDown">
            
            <a href="/categories/FrontEnd"><b>「
                </b>FRONTEND<b> 」</b></a>
            
            十一月 02, 2019
        </p>
        <h3 class="post-title animated fadeInDown">
            <a href="/2019/11/02/frontend/simplify-your-javascript-with.html" title="JavaScript中更简便的数组处理函数.map()，.reduce()，.filter()" class="posttitle">JavaScript中更简便的数组处理函数.map()，.reduce()，.filter()</a></h3>
        
        <p class="post-count animated fadeInDown">
            
            <span>
                <b class="iconfont icon-text2"></b> <i>文章字数</i>
                9.3k
            </span>
            
            
            <span>
                <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                8 mins.
            </span>
            
            
        </p>
        
        
        <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/ES6/">ES6</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/JavaScript/">JavaScript</a></li></ul>
        
        <div class="md-content animated fadeIn">
            
            <p>如果你刚接触JavaScript可能你还没有听说过<code>.map()</code>，<code>.reduce()</code>，<code>.filter()</code>。或者听说过，看过别人用过但是自己在实际项目中没有用过。在国内很多开发项目都是需要考虑IE8的兼容，为了兼容很多JavaScript好用的方法和技巧都被埋没了。但是我发现近几年开始，很多开发项目已经完全抛弃了IE这个魔鬼了。如果你不需要兼容古老的IE浏览器了，那就要开始熟悉一下这几个方法来处理数组。</p>
<blockquote>
<p>注意这遍文章说的的3个方法其实在很多其他语言都可以使用到，因为这几个方法和使用概念在很多其他语言都是存在的。...</p></blockquote>
            
            <span class="read-more"><a href="/2019/11/02/frontend/simplify-your-javascript-with.html" title="查看全文" class="posttitle">查看全文</a>
                <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
    
</div>

<div class="screen-gradient-after">
    <div class="screen-gradient-content">
        <div class="screen-gradient-content-inside">
            <div class="bold-underline-links screen-gradient-sponsor">
                <p>
                    <span class="typed-text"></span>
                </p>
            </div>
        </div>
    </div>
</div>

    <div id="primary">
        
<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571765343/blog/programming-learning-tips_orzxb3.jpg);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/Notes">
                  <b>「 </b>NOTES<b> 」</b>
                </a>
            
            十一月 01, 2019
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2019/11/01/notes/learn-programming-more-effectively.html" title="如何高效学习编程" class="posttitle">如何高效学习编程</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        8.6k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        8 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Learning/">Learning</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Notes/">Notes</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Programming/">Programming</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <p>编程确实不是一件容易的事情，除了要有较强的<code>逻辑思维</code>，还需要<code>花大量的时间和集中力来提升和维持一定的高度</code>。</p>
<p>与其他的领域不一样的是，技术每日都在变，所以对于编程初学者是很难一直与时并进的。就算是技术大神和老司机们也是追赶的比较吃力的。在技术领域打滚的这些年里，通过经历和经验总结出一些高效的学习方式和方法，在这篇文章里与大家分享。让我们现在就在技术领域的学习之路上奔跑吧！</p>
<p>在刚刚接触技术的时候，很多人都会比较迷茫。技术领域有前端后端并且各自有多种编程语言。选定前端后端后又发现越过一山还有一山高，面临更...</p>
            
            <span class="read-more"><a href="/2019/11/01/notes/learn-programming-more-effectively.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571416466/blog/how-to-write-a-service_ixkzuz.jpg);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/BackEnd">
                  <b>「 </b>BACKEND<b> 」</b>
                </a>
            
            十月 19, 2019
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2019/10/19/backend/how-to-write-a-service.html" title="真正的`服务层`是怎么写的?" class="posttitle">真正的`服务层`是怎么写的?</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        10k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        9 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Architecture/">Architecture</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/PHP/">PHP</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Service/">Service</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <p>其实很多系统架构里面都有服务层，但是服务对很多开发人员来说都有很多不同的定义和写法。甚至在我待过的公司里都有不同的写法和编写模式。每个人每个团队每个项目都有对服务不同的理解。那到底什么是服务，怎么理解才是对的呢？</p>
<p>你们有没有过无数个夜晚里严重怀疑人生，琢磨着到底哪一种服务才是对的？哪一种才是最好的写法，哪一种才能达到服务的真正意义？因为这种执着，我开始在国外的各种网站，大神们写过的开源大项目里面和文章里面总结出一个大多数研发伙伴们认可的理解方式和编写方式。</p>
<p>要理解什么是服务，我们先来给<code>服务</code>一个<code>定...</code></p>
            
            <span class="read-more"><a href="/2019/10/19/backend/how-to-write-a-service.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571154304/blog/javascript_console_nyqvkf.jpg);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/FrontEnd">
                  <b>「 </b>FRONTEND<b> 」</b>
                </a>
            
            十月 11, 2019
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2019/10/11/frontend/debugging-skills-console.html" title="使用Console技巧提高JS调试技能" class="posttitle">使用Console技巧提高JS调试技能</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        6.8k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        6 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Console/">Console</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Debugging/">Debugging</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/JavaScript/">JavaScript</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <p>其实 <strong>JavaScript</strong> 给到我们很多调试工具来调试代码，那问问你自己，你又知道多少呢？用到多少呢？</p>
<p>大部分前端开发在 <strong>JavaScript</strong> 调试代码的常规用法都是直接<code>console.log</code>，直接输出某一个变量或者返回数据里面的对象数据。当然毋庸置疑这样输出来调试是没有问题的。但是不是最优雅的方式来调试代码，其实还有更好的办法。作为一个有追求的技术人才，有更好的调试方式为什么不去使用呢？</p>
<p></p>
<p>我们先来了解清楚浏览器的<code>console</code>。浏览器的<code>console</code>对象有提供自带的调试控制台。<code>console...</code></p>
            
            <span class="read-more"><a href="/2019/10/11/frontend/debugging-skills-console.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://s2.ax1x.com/2019/09/18/n7ku11.png);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/运维">
                  <b>「 </b>运维<b> 」</b>
                </a>
            
            九月 10, 2019
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2019/09/10/server/aliyun-webhook-setup.html" title="GitLab Webhook 自动部署" class="posttitle">GitLab Webhook 自动部署</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        2.9k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        3 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Gitlab/">Gitlab</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Webhook/">Webhook</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <h3 id="创建部署公钥"><a href="#创建部署公钥" class="headerlink" title="创建部署公钥"></a>创建部署公钥</h3><pre><code class="bash">sudo -Hu www ssh-keygen -t rsa</code></pre>
<blockquote>
<p>如果创建失败首先需要创建/home/www/.ssh这个文件夹</p>
</blockquote>
<h3 id="查看公钥"><a href="#查看公钥" class="headerlink" title="查看公钥"></a>查看公钥</h3><pre><code class="bash">cat /home/www/.ssh/id_rsa.pub</code></pre>
<h3 id="添加Hook"><a href="#添加Hook" class="headerlink" title="添加Hook"></a>添加Hook</h3><p>在阿里云code.aliyun.com上的profile&gt;ssh_key里面添加公钥</p>
<pre><code class="bash">sudo -Hu www git clone [git地址]</code></pre>
<blockquote>
<p>这里注意, 一定要用www的身份状态要不后期无法自动git pull</p>
</blockquote>
<h3 id="Shell-exec"><a href="#Shell-exec" class="headerlink" title="Shell_exec"></a>Shell_exec</h3><p>在使用这个PHP脚本的时候我们...</p>
            
            <span class="read-more"><a href="/2019/09/10/server/aliyun-webhook-setup.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571213684/blog/lumn_cover_uujop9.png);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/Laravel">
                  <b>「 </b>LARAVEL<b> 」</b>
                </a>
            
            一月 10, 2019
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2019/01/10/laravel/lumen-passport-usage.html" title="Lumen 使用 laravel passport" class="posttitle">Lumen 使用 laravel passport</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        6.5k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        6 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Laravel-Passport/">Laravel Passport</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Lumen/">Lumen</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <p>Lumen是laravel的简洁版, 把laravel里面深重的依赖都去掉了, 所以直接安装laravel的passport是无法正常使用的.<br>所以如果要在lumen上使用laravel的passport就需要安装另外一个插件.</p>
<ul>
<li>PHP &gt;= 5.6.3</li>
<li>Lumen &gt;= 5.3</li>
</ul>
<p>首先安装 Lumen Passport</p>
<pre><code class="bash"># 进入项目根目录
$ cd lumen-app

# 使用composer安装插件
$ composer require dusterio/lumen-passport...</code></pre>
            
            <span class="read-more"><a href="/2019/01/10/laravel/lumen-passport-usage.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571213684/blog/lumn_cover_uujop9.png);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/Laravel">
                  <b>「 </b>LARAVEL<b> 」</b>
                </a>
            
            一月 10, 2019
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2019/01/10/laravel/lumen-multi-oauth.html" title="Lumen passport实现多个用户体系下的oauth验证" class="posttitle">Lumen passport实现多个用户体系下的oauth验证</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        5.5k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        5 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Laravel-Passport/">Laravel Passport</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Lumen/">Lumen</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <p>这个教程是基于, lumen里面已经安装好了lumen-passport的插件, 如果还没有的话可以先到<a href="/2019/01/10/2019-01-10-lumen-passport-usage/">lumen使用laravel passport教程</a>先安装.</p>
<blockquote>
<p>文件路径 <code>vendor\laravel\passport\src\Bridge\UserRepository.php</code></p>
</blockquote>
<ul>
<li><p>首先需要改写<code>userRepositroy</code>里面的<code>getUserEntityByUserCredentials</code>方法</p>
</li>
<li><p>复制<code>userRepositroy</code>里面的<code>getUserEntityByUserCredentials...</code></p></li></ul>
            
            <span class="read-more"><a href="/2019/01/10/laravel/lumen-multi-oauth.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571186961/blog/ionic_cover_hvzkwo.png);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/Ionic">
                  <b>「 </b>IONIC<b> 」</b>
                </a>
            
            四月 24, 2017
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2017/04/24/ionic/listen-to-back-button.html" title="IONIC 2 实现首页双击退出APP" class="posttitle">IONIC 2 实现首页双击退出APP</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        2.4k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        2 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Angular-4/">Angular 4</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Hybird-App/">Hybird App</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Ionic-2/">Ionic 2</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <blockquote>
<p>首先在<code>app/app.html</code>下加入<code>#myNav</code>, 这个是用于绑定当前页面的导航标签</p>
</blockquote>
<pre><code class="html"> &lt;ion-nav #myNav [root]=&quot;rootPage&quot;&gt;&lt;/ion-nav&gt;</code></pre>
<blockquote>
<p>然后在<code>app.component.ts</code>做相对的改动</p>
</blockquote>
<pre><code class="ts">import { Component, ViewChild } from &#39;@angular/core&#39;;
import { Platform, ToastController, Nav, App } ...</code></pre>
            
            <span class="read-more"><a href="/2017/04/24/ionic/listen-to-back-button.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571186961/blog/ionic_cover_hvzkwo.png);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/Ionic">
                  <b>「 </b>IONIC<b> 」</b>
                </a>
            
            四月 20, 2017
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2017/04/20/ionic/sliders-autoplay.html" title="IONIC 3 使用sliders轮播时拖动后autoplay失效解决方法" class="posttitle">IONIC 3 使用sliders轮播时拖动后autoplay失效解决方法</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        1.4k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        1 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Angular-4/">Angular 4</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Hybird-App/">Hybird App</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Ionic-3/">Ionic 3</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <h4 id="我们先了解一下Ionic的Sliders"><a href="#我们先了解一下Ionic的Sliders" class="headerlink" title="我们先了解一下Ionic的Sliders"></a>我们先了解一下Ionic的Sliders</h4><blockquote>
<p>首先Ionic里面的sliders是用<a href="http://idangero.us/swiper/api/#.WPhzbPB96Uk" target="_blank" rel="noopener">Swiper.js</a>的第三方插件实现的, Ionic官方Sliders的文档里面只描述了可以直接写入html标签内的属性, 有很多高级属性是没有写在文档里面的. </p>
</blockquote>
<h4 id="要怎么改变sliders的其他属性呢"><a href="#要怎么改变sliders的其他属性呢" class="headerlink" title="要怎么改变sliders的其他属性呢?"></a>要怎么改变sliders的其他属性呢?</h4><blockquote>
<p>那如果我们要用到Swiper的其他属性怎么办呢? Ionic 2.x 的时候我们是可以在options里面传入的, 但是升级Ionic 3.x.x 后sliders的options属性被移除了. 现在要改变sliders...</p></blockquote>
            
            <span class="read-more"><a href="/2017/04/20/ionic/sliders-autoplay.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


<div class="post" id="post">
    <div class="post-cover animated fadeIn" style="
            background-image:
            radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
            url(https://res.cloudinary.com/tridiamond/image/upload/v1571186961/blog/ionic_cover_hvzkwo.png);">
    </div>
    <div class="else">
        <p class="animated fadeInDown">
            
                <a href="/categories/Ionic">
                  <b>「 </b>IONIC<b> 」</b>
                </a>
            
            四月 11, 2017
        </p>
        <h3 class="post-title animated fadeInDown"><a href="/2017/04/11/ionic/ios-blackscreen-fix.html" title="修复 Ionic 3.0.1 在IOS点击Tabs多次出现黑屏问题方法" class="posttitle">修复 Ionic 3.0.1 在IOS点击Tabs多次出现黑屏问题方法</a></h3>
        
            <p class="post-count animated fadeInDown">
                
                    <span>
                        <b class="iconfont icon-text2"></b> <i>文章字数</i>
                        1.3k
                    </span>
                
                
                    <span>
                        <b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
                        1 mins.
                    </span>
                
                
            </p>
            
                <ul class="animated fadeInDown post-tags-list"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Angular-4/">Angular 4</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Hybird-App/">Hybird App</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Ionic-3/">Ionic 3</a></li></ul>
            
        
        <div class="md-content animated fadeIn">
            
                <blockquote>
<p>Ionic 3.0.1 在IOS存在的一个严重的BUG，在IOS下多次重复点击TAB的时候页面会出现黑屏问题。</p>
</blockquote>
<blockquote>
<p>好消息是目前有一个暂时的修复方法。但是这个方法涉及修改Ionic核心代码，所以如果你们正在使用Ionic3发布APP，可以暂时使用以下办法修复问题。</p>
</blockquote>
<blockquote>
<p>在<code>node_modules/ionic-angular/components/tabs/tabs.js</code>找到一下代码 (468行)</p>
</blockquote>
<pre><code class="typescript">getComponent(this._linker, tab.root).then(function...</code></pre>
            
            <span class="read-more"><a href="/2017/04/11/ionic/ios-blackscreen-fix.html" title="查看全文" class="posttitle">查看全文</a> <b class="iconfont icon-arrow-right- gradient-text"></b></span>
        </div>
    </div>
</div>


    </div>
    
    <div id="pager"><a href="/page/2/" class="more" data-loading="加载中..." data-load-more="加载更多">加载更多</a></div>
    
</div>
<div id="preview"></div>

    <div id="back-to-top" class="animated fadeIn faster">
        <div class="flow"></div>
        <span class="percentage animated fadeIn faster">0%</span>
        <span class="iconfont icon-top02 animated fadeIn faster"></span>
    </div>
</body>
<footer>
    <p class="copyright" id="copyright">
        &copy; 2019
        <span class="gradient-text">
            三·钻 TriDiamond
        </span>.
        Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
        Theme
        <span class="gradient-text">
            <a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
        </span>
        <small><a href="https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md" title="v1.4.3" target="_blank" rel="noopener">v1.4.3</a></small>
    </p>
</footer>

<script type="text/javascript" src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script>
  MathJax.Hub.Config({
    "HTML-CSS": {
      preferredFont: "TeX",
      availableFonts: ["STIX", "TeX"],
      linebreaks: {
        automatic: true
      },
      EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
    },
    tex2jax: {
      inlineMath: [
        ["$", "$"],
        ["\\(", "\\)"]
      ],
      processEscapes: true,
      ignoreClass: "tex2jax_ignore|dno",
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
      noUndefined: {
        attributes: {
          mathcolor: "red",
          mathbackground: "#FFEEEE",
          mathsize: "90%"
        }
      },
      Macros: {
        href: "{}"
      }
    },
    messageStyle: "none"
  });
</script>
<script>
  function initialMathJax() {
    MathJax.Hub.Queue(function () {
      var all = MathJax.Hub.getAllJax(),
        i;
      // console.log(all);
      for (i = 0; i < all.length; i += 1) {
        console.log(all[i].SourceElement().parentNode)
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
  }

  function reprocessMathJax() {
    if (typeof MathJax !== 'undefined') {
      MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
    }
  }
</script>



    <link rel="stylesheet" href="//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.css">
    <script src="//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/obsidian.js"></script>
<script src="/js/jquery.truncate.js"></script>
<script src="/js/search.js"></script>
<script src="//cdn.bootcss.com/typed.js/2.0.10/typed.min.js"></script>
<script src="//cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js"></script>

<script src="https://cdn.bootcss.com/codemirror/5.48.4/codemirror.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/javascript/javascript.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/css/css.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/xml/xml.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/htmlmixed/htmlmixed.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/clike/clike.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/php/php.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/shell/shell.min.js"></script>

    <script src="//cdn.bootcss.com/codemirror/5.48.4/mode/python/python.min.js"></script>



    <script src="/js/busuanzi.min.js"></script>
    <script>
        $(document).ready(function () {
            if ($('span[id^="busuanzi_"]').length) {
                initialBusuanzi();
            }
        });
    </script>


<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>



    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="//www.googletagmanager.com/gtag/js?id=UA-149874671-1"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'UA-149874671-1');
    </script>





<script>
    function initialTyped () {
        var typedTextEl = $('.typed-text');
        if (typedTextEl && typedTextEl.length > 0) {
            var typed = new Typed('.typed-text', {
                strings: ["Think like an artist, develop like an artisan", "艺术家思维去思考问题，工匠创造精神去开发"],
                typeSpeed: 90,
                loop: true,
                loopCount: Infinity,
                backSpeed: 20,
            });
        }
    }

    if ($('.article-header') && $('.article-header').length) {
        $(document).ready(function () {
            initialTyped();
        });
    }
</script>




</html>
